home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  6.7 KB  |  264 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Processes.a
  3. ;
  4. ;    Contains:    Process Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  21. __PROCESSES__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  30.     include 'Events.a'
  31.     ENDIF
  32. ;        include 'Quickdraw.a'                                        ;
  33. ;            include 'MixedMode.a'                                    ;
  34. ;            include 'QuickdrawText.a'                                ;
  35. ;        include 'OSUtils.a'                                        ;
  36. ;            include 'Memory.a'                                        ;
  37.  
  38.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  39.     include 'Files.a'
  40.     ENDIF
  41. ;        include 'Finder.a'                                            ;
  42. ProcessSerialNumber     RECORD    0
  43. highLongOfPSN             ds.l   1        ; offset: $0 (0)
  44. lowLongOfPSN             ds.l   1        ; offset: $4 (4)
  45. sizeof                     EQU *            ; size:   $8 (8)
  46.                         ENDR
  47.  
  48. ; typedef struct ProcessSerialNumber  ProcessSerialNumber, *ProcessSerialNumberPtr
  49.  
  50. ; Process identifier - Various reserved process serial numbers 
  51. kNoProcess                        EQU        0
  52. kSystemProcess                    EQU        1
  53. kCurrentProcess                    EQU        2
  54.  
  55. ; Definition of the parameter block passed to _Launch
  56. ;    Typedef and flags for launchControlFlags field 
  57. ; typedef unsigned short     LaunchFlags
  58.  
  59. ; Definition of the parameter block passed to _Launch 
  60. launchContinue                    EQU        $4000
  61. launchNoFileFlags                EQU        $0800
  62. launchUseMinimum                EQU        $0400
  63. launchDontSwitch                EQU        $0200
  64. launchAllow24Bit                EQU        $0100
  65. launchInhibitDaemon                EQU        $0080
  66.  
  67. ; Format for first AppleEvent to pass to new process.  The size of the overall
  68. ;  buffer variable: the message body immediately follows the messageLength 
  69. AppParameters             RECORD    0
  70. theMsgEvent                 ds     EventRecord ; offset: $0 (0)
  71. eventRefCon                 ds.l   1        ; offset: $10 (16)
  72. messageLength             ds.l   1        ; offset: $14 (20)
  73. sizeof                     EQU *            ; size:   $18 (24)
  74.                         ENDR
  75.  
  76. ; typedef struct AppParameters  AppParameters, *AppParametersPtr
  77. ; Parameter block to _Launch 
  78. LaunchParamBlockRec     RECORD    0
  79. reserved1                 ds.l   1        ; offset: $0 (0)
  80. reserved2                 ds.w   1        ; offset: $4 (4)
  81. launchBlockID             ds.w   1        ; offset: $6 (6)
  82. launchEPBLength             ds.l   1        ; offset: $8 (8)
  83. launchFileFlags             ds.w   1        ; offset: $C (12)
  84. launchControlFlags         ds.w   1        ; offset: $E (14)
  85. launchAppSpec             ds.l   1        ; offset: $10 (16)
  86. launchProcessSN             ds     ProcessSerialNumber ; offset: $14 (20)
  87. launchPreferredSize         ds.l   1        ; offset: $1C (28)
  88. launchMinimumSize         ds.l   1        ; offset: $20 (32)
  89. launchAvailableSize         ds.l   1        ; offset: $24 (36)
  90. launchAppParameters         ds.l   1        ; offset: $28 (40)
  91. sizeof                     EQU *            ; size:   $2C (44)
  92.                         ENDR
  93.  
  94. ; typedef struct LaunchParamBlockRec  LaunchParamBlockRec, *LaunchPBPtr
  95. ; Set launchBlockID to extendedBlock to specify that extensions exist.
  96. ; Set launchEPBLength to extendedBlockLen for compatibility.
  97.  
  98. ; Definition of the information block returned by GetProcessInformation 
  99. modeDeskAccessory                EQU        $00020000
  100. modeMultiLaunch                    EQU        $00010000
  101. modeNeedSuspendResume            EQU        $00004000
  102. modeCanBackground                EQU        $00001000
  103. modeDoesActivateOnFGSwitch        EQU        $00000800
  104. modeOnlyBackground                EQU        $00000400
  105. modeGetFrontClicks                EQU        $00000200
  106. modeGetAppDiedMsg                EQU        $00000100
  107. mode32BitCompatible                EQU        $00000080
  108. modeHighLevelEventAware            EQU        $00000040
  109. modeLocalAndRemoteHLEvents        EQU        $00000020
  110. modeStationeryAware                EQU        $00000010
  111. modeUseTextEditServices            EQU        $00000008
  112. modeDisplayManagerAware            EQU        $00000004
  113.  
  114. ; Record returned by GetProcessInformation 
  115. ProcessInfoRec             RECORD    0
  116. processInfoLength         ds.l   1        ; offset: $0 (0)
  117. processName                 ds.l   1        ; offset: $4 (4)
  118. processNumber             ds     ProcessSerialNumber ; offset: $8 (8)
  119. processType                 ds.l   1        ; offset: $10 (16)
  120. processSignature         ds.l   1        ; offset: $14 (20)
  121. processMode                 ds.l   1        ; offset: $18 (24)
  122. processLocation             ds.l   1        ; offset: $1C (28)
  123. processSize                 ds.l   1        ; offset: $20 (32)
  124. processFreeMem             ds.l   1        ; offset: $24 (36)
  125. processLauncher             ds     ProcessSerialNumber ; offset: $28 (40)
  126. processLaunchDate         ds.l   1        ; offset: $30 (48)
  127. processActiveTime         ds.l   1        ; offset: $34 (52)
  128. processAppSpec             ds.l   1        ; offset: $38 (56)
  129. sizeof                     EQU *            ; size:   $3C (60)
  130.                         ENDR
  131.  
  132. ; typedef struct ProcessInfoRec  ProcessInfoRec, *ProcessInfoRecPtr
  133. ;
  134. ; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  135. ;
  136.     IF ¬ GENERATINGCFM THEN
  137.         ; parameters: 
  138.         ;     LaunchParams      => A0
  139.         ; returns: 
  140.         ;     OSErr             <= D0
  141.         _LaunchApplication:    OPWORD    $A9F2
  142.     ELSE
  143.         IMPORT_CFM_FUNCTION    LaunchApplication
  144.     ENDIF
  145.  
  146. ;
  147. ; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  148. ;
  149.     IF ¬ GENERATINGCFM THEN
  150.         Macro
  151.         _LaunchDeskAccessory
  152.             move.w    #$0036,-(sp)
  153.             dc.w     $A88F
  154.         EndM
  155.     ELSE
  156.         IMPORT_CFM_FUNCTION    LaunchDeskAccessory
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  161. ;
  162.     IF ¬ GENERATINGCFM THEN
  163.         Macro
  164.         _GetCurrentProcess
  165.             move.w    #$0037,-(sp)
  166.             dc.w     $A88F
  167.         EndM
  168.     ELSE
  169.         IMPORT_CFM_FUNCTION    GetCurrentProcess
  170.     ENDIF
  171.  
  172. ;
  173. ; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  174. ;
  175.     IF ¬ GENERATINGCFM THEN
  176.         Macro
  177.         _GetFrontProcess
  178.             dc.w     $70FF
  179.             dc.w     $2F00
  180.             move.w    #$0039,-(sp)
  181.             dc.w     $A88F
  182.         EndM
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    GetFrontProcess
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  189. ;
  190.     IF ¬ GENERATINGCFM THEN
  191.         Macro
  192.         _GetNextProcess
  193.             move.w    #$0038,-(sp)
  194.             dc.w     $A88F
  195.         EndM
  196.     ELSE
  197.         IMPORT_CFM_FUNCTION    GetNextProcess
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  202. ;
  203.     IF ¬ GENERATINGCFM THEN
  204.         Macro
  205.         _GetProcessInformation
  206.             move.w    #$003A,-(sp)
  207.             dc.w     $A88F
  208.         EndM
  209.     ELSE
  210.         IMPORT_CFM_FUNCTION    GetProcessInformation
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  215. ;
  216.     IF ¬ GENERATINGCFM THEN
  217.         Macro
  218.         _SetFrontProcess
  219.             move.w    #$003B,-(sp)
  220.             dc.w     $A88F
  221.         EndM
  222.     ELSE
  223.         IMPORT_CFM_FUNCTION    SetFrontProcess
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  228. ;
  229.     IF ¬ GENERATINGCFM THEN
  230.         Macro
  231.         _WakeUpProcess
  232.             move.w    #$003C,-(sp)
  233.             dc.w     $A88F
  234.         EndM
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION    WakeUpProcess
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         Macro
  244.         _SameProcess
  245.             move.w    #$003D,-(sp)
  246.             dc.w     $A88F
  247.         EndM
  248.     ELSE
  249.         IMPORT_CFM_FUNCTION    SameProcess
  250.     ENDIF
  251.  
  252.     IF ¬ OLDROUTINELOCATIONS  THEN
  253. ;
  254. ; pascal void ExitToShell(void)
  255. ;
  256.     IF ¬ GENERATINGCFM THEN
  257.         _ExitToShell:    OPWORD    $A9F4
  258.     ELSE
  259.         IMPORT_CFM_FUNCTION    ExitToShell
  260.     ENDIF
  261.  
  262.     ENDIF
  263.     ENDIF ; __PROCESSES__
  264.